import React, { Component, useState, useEffect } from 'react';
import useIntervalJob from './useIntervalJob';

export default function ReactHook() {
  const [test, setTest] = useState(null);
  const TIME_INTERVAL = 3000;
  useIntervalJob(
    () => {
      setTest(Math.ceil(Math.random() * 10));
    },
    TIME_INTERVAL,
    test,
  );
  return <div>{test}</div>;
}
